#./dockerpull.sh google_containers/kubernetes-dashboard-amd64 v1.5.0 gcr.io
if [ $# -lt 2 ]
then
	echo 从dockerhub.ygsoft.com:5000下载镜像
	echo usage: ./dockerpull.sh image version server
	exit
fi
image=$1
version=$2
server=$3
dockerhub="dockerhub.ygsoft.com:5000/"

if [ $# -eq 3 ]
then
  server=$3/
fi

set -x

docker pull ${dockerhub}${image}:${version}
docker tag ${dockerhub}${image}:${version} ${server}${image}:${version}
docker rmi ${dockerhub}${image}:${version}